/*
 * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
 * Use of this source code is governed by a MIT license that can be
 * found in the LICENSE file.
 */

#pragma once

#include "LinearGradientComponentInstance.h"
#include "RNOH/generated/BaseReactNativeLinearGradientPackage.h"

namespace rnoh {

class LinearGradientPackage : public BaseReactNativeLinearGradientPackage {
    using Super = BaseReactNativeLinearGradientPackage;

public:
    LinearGradientPackage(Package::Context ctx) : Super(ctx) {}

    ComponentInstance::Shared createComponentInstance(const ComponentInstance::Context &ctx) {
        if (ctx.componentName == "RNLinearGradient") {
            return std::make_shared<LinearGradientComponentInstance>(ctx);
        }
        return nullptr;
    };
};
} // namespace rnoh